var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(e, t) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(e, t) {
        e.__proto__ = t;
    } || function(e, t) {
        for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]);
    })(e, t);
}, function(e, t) {
    function r() {
        this.constructor = e;
    }
    o(e, t), e.prototype = null === t ? Object.create(t) : (r.prototype = t.prototype, 
    new r());
}), a = this && this.__decorate || function(e, t, r, i) {
    var s, a = arguments.length, n = a < 3 ? t : null === i ? i = Object.getOwnPropertyDescriptor(t, r) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(e, t, r, i); else for (var l = e.length - 1; 0 <= l; l--) (s = e[l]) && (n = (a < 3 ? s(n) : 3 < a ? s(t, r, n) : s(t, r)) || n);
    return 3 < a && n && Object.defineProperty(t, r, n), n;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("LoadManager"), s = e("Global"), c = cc._decorator, l = c.ccclass, d = c.property, u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.frameSprite = null, e.sprite = null, e.label = null, e.data = null, e;
    }
    return i(e, t), e.prototype.start = function() {}, e.prototype.init = function(e) {
        var t = this;
        switch ((this.data = e).type) {
          case s.RewardType.DIAMOND:
            r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框紫",
                sprite: this.frameSprite
            }), r.default.getInstance().loadSpriteFrame({
                url: "image/ui/钻石2@2x",
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = 1;
                }
            }), null == e.num || isNaN(e.num) || (this.label.string = e.num.toString());
            break;

          case s.RewardType.MONEY:
            r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框紫",
                sprite: this.frameSprite
            }), r.default.getInstance().loadSpriteFrame({
                url: "image/ui/金币@2x",
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = 1;
                }
            }), null == e.num || isNaN(e.num) || (this.label.string = e.num.toString());
            break;

          case s.RewardType.SKIN:
            null == e.idx || isNaN(e.idx) || (r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框蓝",
                sprite: this.frameSprite
            }), e.idx < 1e3 ? (r.default.getInstance().loadSpriteFrame({
                url: "image/skin/" + e.idx,
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = 1;
                }
            }), this.label.string = s.G.personModelList[e.idx].m) : (r.default.getInstance().loadSpriteFrame({
                url: "image/skin2/" + (e.idx - 1e3),
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = 1;
                }
            }), this.label.string = s.G.eggPersonModelList[e.idx - 1e3].m));
            break;

          case s.RewardType.PET:
            r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框绿",
                sprite: this.frameSprite
            }), r.default.getInstance().loadSpriteFrame({
                url: "image/skin3/0",
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = 1;
                }
            }), this.label.string = "机械狗";
            break;

          case s.RewardType.ARM:
            null == e.idx || isNaN(e.idx) || (r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框蓝",
                sprite: this.frameSprite
            }), e.idx < 1e3 ? (r.default.getInstance().loadSpriteFrame({
                url: "image/arm/" + e.idx,
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = .35;
                }
            }), this.label.string = s.G.gunModelList[e.idx].m) : e.idx < 2e3 ? (r.default.getInstance().loadSpriteFrame({
                url: "image/arm3/" + (e.idx - 1e3),
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = .35;
                }
            }), this.label.string = s.G.eggGunModelList[e.idx - 1e3].m) : (r.default.getInstance().loadSpriteFrame({
                url: "image/arm_draw/" + (e.idx - 2e3),
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = .35;
                }
            }), this.label.string = s.G.drawGunModelList[e.idx - 2e3].m));
            break;

          case s.RewardType.PIECE:
            r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框黄",
                sprite: this.frameSprite
            }), r.default.getInstance().loadSpriteFrame({
                url: "image/ui/碎片@2x",
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = .35;
                }
            }), null == e.num || isNaN(e.num) || (this.label.string = e.num.toString());
            break;

          case s.RewardType.DRAGON:
            r.default.getInstance().loadSpriteFrame({
                url: "image/ui/视频排行框绿",
                sprite: this.frameSprite
            }), r.default.getInstance().loadSpriteFrame({
                url: "image/skin3/1",
                sprite: this.sprite,
                success: function() {
                    t.sprite.node.scale = 1;
                }
            }), this.label.string = "机甲暴龙";
        }
    }, a([ d(cc.Sprite) ], e.prototype, "frameSprite", void 0), a([ d(cc.Sprite) ], e.prototype, "sprite", void 0), 
    a([ d(cc.Label) ], e.prototype, "label", void 0), a([ l ], e);
}(cc.Component);

n.default = u;